package com.clear.chain.demo.demo1;

public class Main {
    public static void main(String[] args) {
        ProductInfo productInfo = new ProductInfo();

        // 创建责任链
        ServiceHandlerChain chain = new ServiceHandlerChain();
        chain.addHandler(new BasicInfoServiceHandler());
        chain.addHandler(new PriceServiceHandler());
        chain.addHandler(new ActivityServiceHandler());
        chain.addHandler(new InventoryServiceHandler());

        // 执行责任链
        ProductInfo result = chain.execute(productInfo);

        // 处理最终的商品信息对象
        System.out.println(result.toString());
    }
}
